<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>Magnetic Field Sensor<br/>
<small>
[<a class="el" href="group___hi_technic.html">HiTechnic</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hitechnic-magfield_8h.html">hitechnic-magfield.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>HiTechnic Magnetic Field Sensor driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gab5afd546d63e41b547495b529f59d0ed">HTMAGreadVal</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#ga1f6ace360adedaf07e98e9292992ae72">HTMAGreadRaw</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#ga30c19d3308b0eab3894e12737fd885e2">HTMAGstartCal</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gaf51bef5f6878f95a6ad08d2dd182f787">HTMAGreadCal</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gaf260a08c10f0b92e72f595c0e17d7164">HTMAGsetCal</a> (tSensors link, int bias)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gaab2e6bf5dabfc676fc9f4753ccf98959">HTMAGreadVal</a> (<a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a> muxsensor)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#ga3079bd312507c62d4ae7495e6d55dada">HTMAGreadRaw</a> (<a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a> muxsensor)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gaf099439581b88b472fc3bdfcaf93ba49">HTMAGstartCal</a> (<a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a> muxsensor)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#ga087da3950882be8fbaf8e98885c9c551">HTMAGreadCal</a> (<a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a> muxsensor)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gaf9bb11a091b61f649e545f3e68c46a1a">HTMAGsetCal</a> (<a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a> muxsensor, int bias)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_m_a_g.html#gacbde9fc9f5be2ffda1a0ceaeaa1c3212">HTMAG_bias</a> [][]</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>HiTechnic Magnetic Field Sensor </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaf51bef5f6878f95a6ad08d2dd182f787"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGreadCal" ref="gaf51bef5f6878f95a6ad08d2dd182f787" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGreadCal </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieve the current bias for the sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTMAG port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the bias value for the sensor </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-magfield-_s_m_u_x-test1_8c-example.html#a2">hitechnic-magfield-SMUX-test1.c</a>, and <a class="el" href="hitechnic-magfield-test1_8c-example.html#a1">hitechnic-magfield-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00196">196</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga087da3950882be8fbaf8e98885c9c551"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGreadCal" ref="ga087da3950882be8fbaf8e98885c9c551" args="(tMUXSensor muxsensor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGreadCal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a>&#160;</td>
          <td class="paramname"> <em>muxsensor</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieve the current bias for the sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">muxsensor</td><td>the SMUX sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the bias value for the sensor </dd></dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00207">207</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga1f6ace360adedaf07e98e9292992ae72"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGreadRaw" ref="ga1f6ace360adedaf07e98e9292992ae72" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGreadRaw </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the raw value of the Magnetic Field Sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTMAG port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the Magnetic Field Sensor (approx 300 to 700) </dd></dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00094">94</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga3079bd312507c62d4ae7495e6d55dada"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGreadRaw" ref="ga3079bd312507c62d4ae7495e6d55dada" args="(tMUXSensor muxsensor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGreadRaw </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a>&#160;</td>
          <td class="paramname"> <em>muxsensor</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the raw value of the Magnetic Field Sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">muxsensor</td><td>the SMUX sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the Magnetic Field Sensor (approx 300 to 700) </dd></dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00111">111</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="gab5afd546d63e41b547495b529f59d0ed"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGreadVal" ref="gab5afd546d63e41b547495b529f59d0ed" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGreadVal </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the value of the Magnetic Field Sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTMAG port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the Magnetic Field Sensor (-200 to +200) </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-magfield-_s_m_u_x-test1_8c-example.html#a3">hitechnic-magfield-SMUX-test1.c</a>, and <a class="el" href="hitechnic-magfield-test1_8c-example.html#a2">hitechnic-magfield-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00066">66</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaab2e6bf5dabfc676fc9f4753ccf98959"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGreadVal" ref="gaab2e6bf5dabfc676fc9f4753ccf98959" args="(tMUXSensor muxsensor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGreadVal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a>&#160;</td>
          <td class="paramname"> <em>muxsensor</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the value of the Magnetic Field Sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">muxsensor</td><td>the SMUX sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the value of the Magnetic Field Sensor (-200 to +200) </dd></dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00083">83</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf260a08c10f0b92e72f595c0e17d7164"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGsetCal" ref="gaf260a08c10f0b92e72f595c0e17d7164" args="(tSensors link, int bias)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HTMAGsetCal </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>bias</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Override the current bias for the sensor manually </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTMAG port number </td></tr>
    <tr><td class="paramname">bias</td><td>the new bias to be used </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00174">174</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf9bb11a091b61f649e545f3e68c46a1a"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGsetCal" ref="gaf9bb11a091b61f649e545f3e68c46a1a" args="(tMUXSensor muxsensor, int bias)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void HTMAGsetCal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a>&#160;</td>
          <td class="paramname"> <em>muxsensor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>bias</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Override the current bias for the sensor manually </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">muxsensor</td><td>the SMUX sensor port number </td></tr>
    <tr><td class="paramname">bias</td><td>the new bias to be used </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00185">185</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga30c19d3308b0eab3894e12737fd885e2"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGstartCal" ref="ga30c19d3308b0eab3894e12737fd885e2" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGstartCal </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calibrate the sensor by calculating the average bias of 5 raw readings. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTMAG port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new bias value for the sensor </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-magfield-_s_m_u_x-test1_8c-example.html#a1">hitechnic-magfield-SMUX-test1.c</a>, and <a class="el" href="hitechnic-magfield-test1_8c-example.html#a0">hitechnic-magfield-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00122">122</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf099439581b88b472fc3bdfcaf93ba49"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAGstartCal" ref="gaf099439581b88b472fc3bdfcaf93ba49" args="(tMUXSensor muxsensor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTMAGstartCal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a>&#160;</td>
          <td class="paramname"> <em>muxsensor</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calibrate the Magnetic Field Sensor by calculating the average bias of 5 raw readings. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">muxsensor</td><td>the SMUX sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the new bias value for the Magnetic Field Sensor </dd></dl>

<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00151">151</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="gacbde9fc9f5be2ffda1a0ceaeaa1c3212"></a><!-- doxytag: member="hitechnic&#45;magfield.h::HTMAG_bias" ref="gacbde9fc9f5be2ffda1a0ceaeaa1c3212" args="[][]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group___h_t_m_a_g.html#gacbde9fc9f5be2ffda1a0ceaeaa1c3212">HTMAG_bias</a>[][]</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {{512, 512, 512, 512}, 
                          {512, 512, 512, 512},
                          {512, 512, 512, 512},
                          {512, 512, 512, 512}}
</pre></div>
<p>Definition at line <a class="el" href="hitechnic-magfield_8h_source.html#l00056">56</a> of file <a class="el" href="hitechnic-magfield_8h_source.html">hitechnic-magfield.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
